/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package queenb.web.store;
import java.sql.SQLException;
import java.util.Date;
import java.util.List;
import javax.faces.model.SelectItem;
import oracle.jdbc.OracleTypes;
import queenb.net.datacontrol.DataStatement;
import queenb.net.datacontrol.Param;
import queenb.net.entitybean.B050;
import queenb.web.util.PackageContants;
/**
 *
 * @author ems
 */
public class B050Store extends B050{
    
    public List<B050> listCombbB050(int pnFH000,int pnFH200,String pvLogin)throws SQLException, InstantiationException, IllegalAccessException 
    {
        DataStatement dataStatement = new DataStatement(PackageContants.LIST_COMBB050, OracleTypes.CURSOR, new Param[]{
                                                        new Param(OracleTypes.INTEGER, pnFH000),
                                                        new Param(OracleTypes.INTEGER, pnFH200),
                                                        new Param(OracleTypes.CHAR, pvLogin)
        });
        return super.find(dataStatement, B050.class);
    }
    
    public List<B050> listB050(int pnFH000,int pnFH200,String pvBV051,String pvLogin) throws SQLException, InstantiationException, IllegalAccessException {
        DataStatement dataStatement = new DataStatement(PackageContants.LIST_B050, OracleTypes.CURSOR, new Param[]{
                                                        new Param(OracleTypes.INTEGER, pnFH000),
                                                        new Param(OracleTypes.INTEGER, pnFH200),
                                                        new Param(OracleTypes.CHAR, pvBV051),
                                                        new Param(OracleTypes.CHAR, pvLogin)
        });
        return super.find(dataStatement, B050.class);
    }


    public int deleteB050(int pnPB050,String pvLOGIN) throws SQLException, InstantiationException, IllegalAccessException {
        DataStatement dataStatement = new DataStatement(PackageContants.DELETE_Q150, OracleTypes.INTEGER, new Param[]{
                    new Param(OracleTypes.INTEGER, pnPB050),
                    new Param(OracleTypes.CHAR, pvLOGIN)
                });
        return update(dataStatement, B050.class);
    }

    public int updateB050(
            int pnPB050,int pnFH000,int pnFH200 ,int pnFS200,
            int pnFH075,int pnFH150,String pvBV051 ,String pvBV052,
            Date pdBD053,String pvBV054,int pnBN055 ,int pnBN056,
            int pnBN057,int pnBN058,int pnBN059 ,String pvBV060,
            int pnBN061,int pnBN062,String pvLOGIN

            ) throws SQLException {
        DataStatement updateStatement = new DataStatement(PackageContants.UPDATE_B050, OracleTypes.INTEGER, new Param[]{
                    new Param(OracleTypes.INTEGER, pnPB050),
                    new Param(OracleTypes.INTEGER, pnFH000),
                    new Param(OracleTypes.INTEGER, pnFH200),
                    new Param(OracleTypes.INTEGER, pnFS200),
                    new Param(OracleTypes.INTEGER, pnFH075),
                    new Param(OracleTypes.INTEGER, pnFH150),
                    new Param(OracleTypes.CHAR, pvBV051),
                    new Param(OracleTypes.CHAR, pvBV052),
                    new Param(OracleTypes.DATE, pdBD053),
                    new Param(OracleTypes.CHAR, pvBV054),
                    new Param(OracleTypes.INTEGER, pnBN055),
                    new Param(OracleTypes.INTEGER, pnBN056),
                    new Param(OracleTypes.INTEGER, pnBN057),
                    new Param(OracleTypes.INTEGER, pnBN058),
                    new Param(OracleTypes.INTEGER, pnBN059),
                    new Param(OracleTypes.CHAR, pvBV060),
                    new Param(OracleTypes.INTEGER, pnBN061),
                    new Param(OracleTypes.INTEGER, pnBN062),
                    new Param(OracleTypes.CHAR, pvLOGIN)}
                    );
        return super.update(updateStatement, null);
    }
}
